package com.wits.platform.dao.impl;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Component;

import com.wits.platform.dao.custom.RoleDaoCustom;
import com.wits.platform.entity.Role;

@Component
public class RoleDaoImpl extends BaseDaoImpl<Role,String> implements RoleDaoCustom{

	@SuppressWarnings("rawtypes")
	@Override
	public List<Map> findForUser(String userId) {
		String sql="select r.role_id as ROLEID,r.role_name as ROLENAME,case when ur.user_id='"+userId+"' then 'true' else 'false' end as CHECKED from wits_role r left join wits_mmr_user_role ur on(ur.role_id=r.role_id) and ur.user_id=?";
		return this.findByHibernateNative(sql, userId);
	}

}
